package com.frank.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.frank.subject.infra.basic.entity.SubjectInfo;
import com.frank.subject.infra.basic.mapper.SubjectInfoMapper;
import com.frank.subject.infra.basic.service.SubjectInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 题目信息表(SubjectInfo)表服务实现类
 *
 * @author makejava
 * @since 2024-01-23 17:20:39
 */
@Service("subjectInfoService")
public class SubjectInfoServiceImpl extends ServiceImpl<SubjectInfoMapper, SubjectInfo> implements SubjectInfoService {

    private final SubjectInfoMapper subjectInfoMapper;

    public SubjectInfoServiceImpl(SubjectInfoMapper subjectInfoMapper) {
        this.subjectInfoMapper = subjectInfoMapper;
    }

    @Override
    public int countByCondition(SubjectInfo subjectInfo, Long labelId, Long categoryId) {
        return this.subjectInfoMapper.countByCondition(subjectInfo, labelId, categoryId);
    }

    @Override
    public List<SubjectInfo> queryPage(SubjectInfo subjectInfo, Long categoryId, Long labelId, int start, Integer pageSize) {
        return this.subjectInfoMapper.queryPage(subjectInfo, categoryId, labelId, start, pageSize);
    }
}
